#!/bin/bash

# Flutter快速构建Android APK脚本
# 用法: ./quick_build.sh [构建类型]
# 构建类型: debug, profile, release (默认: release)

# 颜色定义
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m'

BUILD_TYPE=${1:-release}

# 获取应用信息
APP_NAME=$(grep "^name:" pubspec.yaml | cut -d' ' -f2)
VERSION=$(grep "^version:" pubspec.yaml | cut -d' ' -f2 | cut -d'+' -f1)

echo -e "${BLUE}🚀 快速构建Android APK${NC}"
echo -e "${YELLOW}应用:${NC} $APP_NAME v$VERSION"
echo -e "${YELLOW}类型:${NC} $BUILD_TYPE"
echo ""

# 直接调用详细构建脚本
./scripts/build_with_version.sh android "$BUILD_TYPE"